local s = require "service"
local runconfig = require "runconfig"
local skynet = require "skynet"
local skynet_manager = require "skynet.manager"  -- skynet.name

-- scene_mgr只管理当前node的场景

local scene_id2node = {}


s.resp.get_scene_node = function(source, scene_id)
    local scene_node = scene_id2node[scene_id]
    if not scene_node then
        return false
    end

    return true, scene_node
end

s.init = function()
    local mynode = skynet.getenv("node")
    for _, scene_id in pairs(runconfig.scene[mynode] or {}) do
        local srv = skynet.newservice("scene", "scene", scene_id)
        skynet.name("scene" .. scene_id, srv)
        scene_id2node[scene_id] = srv
    end
end

s.start(...)